# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from django.conf.urls.defaults import *
from onlypy.feeds.models import LatestEntries

feeds = {
    'latest': LatestEntries,
}

urlpatterns = patterns('',
    (r'^$', 'onlypy.blog.views.list_post'),
    (r'update/$', 'onlypy.blog.views.update'),
    (r'^about/$', 'onlypy.blog.views.about'),

    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
    (r'^rss/latest/$', 'onlypy.feeds.views.latest_feed_proxy'),
    
    
)

urlpatterns += patterns('onlypy.account.views',    
    (r'^login/$', 'login'),
    (r'^logout/$', 'logout'),
)

urlpatterns += patterns('onlypy.blog.views',
    (r'^post/add/$', 'add_post'),
    (r'^post/list/$', 'list_post'),
    (r'^post/list_all/$', 'list_all_post'),
    (r'^post/(?P<post_id>\d+)/$', 'view_post'),
    (r'^post/(?P<post_id>\d+)/edit/$', 'edit_post'),
    (r'^postlinks/$', 'post_links'),
    
    (r'^category/add/$', 'add_category'),
    (r'^category/(?P<category_id>\d+)/$', 'list_category_post'),
    (r'^search/$', 'search'),
    
    (r'^sitemap/$', 'sitemap'),
)
